import java.sql.SQLOutput;
import java.util.Scanner;

/**
 * @author Lxh
 * @version 2022.1.2
 * @date 2022/5/1 9:22
 */


public class TestDemo01 {
    /*    public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);
            int a = scanner.nextInt();
            int i = 2;
            for(; i <= a/2 ; i++){
                if(a%i == 0){
                    System.out.println("不是素数");
                    break;
                }
            }
            //1.i==a  2.a%i==0
            if(i > a/2){
                System.out.println("是素数");
            }
        }

        public static void main1(String[] args) {
           // Scanner scanner = new Scanner(System.in);
            //int a = scanner.nextInt();
            int i = 2;
            for(; i < a ; i++){
                if(a%i == 0){
                    System.out.println("不是素数");
                    break;
                }
            }
            //1.i==a  2.a%i==0
            if(i == a){
                System.out.println("是素数");
            }
        }

        public static void main2(String[] args) {
            Scanner scanner = new Scanner(System.in);
            int a = scanner.nextInt();
            int i = 2;
            for(; i <= Math.sqrt(n) ; i++){
                if(a%i == 0){
                    System.out.println("不是素数");
                    break;
                }
            }
            //1.i==a  2.a%i==0
            if(i > Math.sqrt(n)){
                System.out.println("是素数");
            }
        }*/
/*public static void main(String[] args) {
    //辗转相除法
    Scanner scanner = new Scanner(System.in);
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    int c = a%b;
    int b1 = b;
    while (c != 0) {
        a = b1;
        b1 = c;
        c = a%b1;
    }
    System.out.println(b1+" 是最大公约数！");
    //知道最大公约数，算最小公倍数
    //可以将两数相乘再除以最大公约数
    System.out.println(a*b/b1+"最小公倍数! ");
    }*/
/*public static void main(String[] args) {
    for (int i = 1; i < 999999; i++) {
        int count=0;//位数
        int tmp = i;
        while(tmp != 0){
            count++;
            tmp /= 10;

        }
        //tmp ==0; count==计算出的位数;
        tmp = i;
        int sum = 0;
        while(tmp != 0){
            sum += Math.pow(tmp%10,count);
            tmp /= 10;
        }
        //此时tmp中存放的就是每一位的count次方和
        if(sum == i){
            System.out.println(i);
        }
    }*/
/*public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int n = scanner.nextInt();
    int count = 0;
    for(int i=0;i<32;i++){
        if( ( (n>>i) &1) != 0 ){
            count++;
        }
    }
    System.out.println(count);
}*/
/*public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int count = 0;
        while (n != 0) {
            if ((n & 1) != 0) {
                count++;
            }
            n = n >>> 1;
        }
        System.out.println(count);
}*/
public static void main(String[] args) {
        Scanner scanner= new Scanner(System.in);
        int n = scanner.nextInt();
        int count = 0;
        while(n != 0){
            n = n&(n-1);
            count++;
        }
        System.out.println(count);
    }
}


